/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "RULETABLE", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Ruletable.findAll", query = "SELECT r FROM Ruletable r"),
    @NamedQuery(name = "Ruletable.findBySc", query = "SELECT r FROM Ruletable r WHERE r.sc = :sc"),
    @NamedQuery(name = "Ruletable.findByCmd", query = "SELECT r FROM Ruletable r WHERE r.cmd = :cmd"),
    @NamedQuery(name = "Ruletable.findByFinalcmd", query = "SELECT r FROM Ruletable r WHERE r.finalcmd = :finalcmd"),
    @NamedQuery(name = "Ruletable.findByModule", query = "SELECT r FROM Ruletable r WHERE r.module = :module"),
    @NamedQuery(name = "Ruletable.findById", query = "SELECT r FROM Ruletable r WHERE r.id = :id")})
public class Ruletable implements Serializable {

    private static final long serialVersionUID = 1L;
    @Size(max = 5)
    @Column(name = "SC")
    private String sc;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "CMD")
    private String cmd;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "FINALCMD")
    private String finalcmd;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "MODULE")
    private String module;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Integer id;

    public Ruletable() {
    }

    public Ruletable(Integer id) {
        this.id = id;
    }

    public Ruletable(Integer id, String cmd, String finalcmd, String module) {
        this.id = id;
        this.cmd = cmd;
        this.finalcmd = finalcmd;
        this.module = module;
    }

    public String getSc() {
        return sc;
    }

    public void setSc(String sc) {
        this.sc = sc;
    }

    public String getCmd() {
        return cmd;
    }

    public void setCmd(String cmd) {
        this.cmd = cmd;
    }

    public String getFinalcmd() {
        return finalcmd;
    }

    public void setFinalcmd(String finalcmd) {
        this.finalcmd = finalcmd;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ruletable)) {
            return false;
        }
        Ruletable other = (Ruletable) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.Ruletable[ id=" + id + " ]";
    }
}
